package com.tgy.crud.utils;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

public class Util {

    public static String getJessionId(String prefix,String suffix){

        return prefix + "::" + suffix;
    }

    public static Cookie getCookie(HttpServletRequest request,String key){

        for (Cookie cookie : request.getCookies()) {

            if (cookie.getName().equals(key)){

                return cookie;
            }
        }

        return null;
    }
}
